package com.example.view.custom;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

public class MyScrollView extends ScrollView {

    public ScrollViewListener scrollViewListener;

    public void setOnScrollViewListener(ScrollViewListener scrollViewListener) {
        this.scrollViewListener = scrollViewListener;
    }

    public MyScrollView(Context context) {
        super(context);
    }

    public MyScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        scrollViewListener.onScrollViewChangeListener(l, t, oldl, oldt);
    }

    public interface ScrollViewListener{
        void onScrollViewChangeListener(int scrollX, int scrollY, int oldScrollX, int oldScrollY);
    }


}
